# settings.py
# stickurity

import os
PROJECT_DIR = os.path.dirname(__file__)

from platform import node
DEPLOYMENT_HOST = "stickurity.alwaysdata.net"
DEPLOYMENT = False
DEVELOPMENT = False
if node() == DEPLOYMENT_HOST:
	DEPLOYMENT = True
else:
	DEVELOPMENT = True

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
	('Omar Abudayyeh', 'omar@stickurity.com'),
    ('David Yamnitsky', 'david@stickurity.com'),
)

MANAGERS = ADMINS

if DEVELOPMENT:
	databasePath = os.path.join(PROJECT_DIR, "stickurity_test_db.sqlite")
	DATABASES = {
		'default': {
		'ENGINE': 'django.db.backends.sqlite3',
		'NAME': databasePath,
		'USER': '',
		'PASSWORD': '',
		'HOST': '',
		'PORT': '',
	}
}
else:
	DATABASES = {
		'default': {
			'ENGINE':	'django.db.backends.mysql',
			'NAME':		'stickurity_main',
			'USER':		'stickurity',
			'PASSWORD': 'whileyouwere',
			'HOST': '',
			'PORT': '',	
		}
	}

if DEVELOPMENT:
	STATIC_ROOT = os.path.join(PROJECT_DIR, "static_collected/")
	STATIC_URL = '/static/'
	
	MEDIA_ROOT = os.path.join(PROJECT_DIR, "media_collected/")
	MEDIA_URL = '/media/'
else:
	STATIC_ROOT = os.path.join(PROJECT_DIR, "static_collected/")
	STATIC_URL = 'http://static.lovelyapps.com/static/'

	MEDIA_ROOT = '/var/media'
	MEDIA_URL = 'http://lovelyapps.com/media/'

ADMIN_MEDIA_PREFIX = '/static/admin/'

STATICFILES_DIRS = (
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    #'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'noreply@stickurity.com'
EMAIL_HOST_PASSWORD = 'whileyouwere'
EMAIL_PORT = 587

SECRET_KEY = '3*ic3$!+bswt^gu8ye1s*f+c(ndd*1lzpwk7cd6+#p+wdm3^99'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    #'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'stickurity.urls'

TEMPLATE_DIRS = (
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    
    'django.contrib.admin',
    'django.contrib.admindocs',
    'stickurity.main',
)

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

TIME_ZONE = 'America/Chicago'
AUTH_PROFILE_MODULE = "main.UserProfile"

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

USE_I18N = True

USE_L10N = True
